<html>
<body bgcolor="#000000" text="#FFFFFF">
<body bgcolor="#000000" text="#FFFFFF">
<?
include("config.php");
$query = 'SELECT TOP 100  Name, Class, clevel,Strength,Energy,Dexterity,Vitality,Resets From Character where CtlCode < 1 order by Energy desc';
$result = mssql_query( $query );
?>

<table width="450" border="0" cellpadding="0" cellspacing="0">
  <!--DWLayoutTable-->
  <tr>
    <td width="450" height="668" valign="top"><div align="center" class="style3">Top
        50 Com mais Energia</div>      
      <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
        <!--DWLayoutTable-->
      <tr>
        <td align="center" valign="middle" bgcolor="#000000"><table width="450" border="1" cellpadding="0" cellspacing="0" bordercolor="#999999" bgcolor="#000000">
		    <tr><td><div align="center"><span class="style4">Nş</span></div></td><td><div align="center"><span class="style4">Nome</span></div></td><td><div align="center"><span class="style4">Classe</span></div></td><td bgcolor="#000000"><div align="center"><span class="style4"><font color="#FFFFFF">Level</font></span></div></td><td bgcolor="#000000"><div align="center"><span class="style4"><font color="#FFFFFF">Força</font></span></div></td><td bgcolor="#FFFF00"><div align="center"><span class="style4"><font color="#000000">Energia</font></span></div></td><td><div align="center"><span class="style4">Agilidade</span></div></td><td bgcolor="#000000"><div align="center"><span class="style4"><font color="#FFFFFF">Vitalidade</font></span></div></td></tr>
            <?
		for($i=0;$i < mssql_num_rows($result);++$i)
			{
			$row = mssql_fetch_row($result);
			$rank = $i+1;
			if($row[1] == 0){ $row[1] =  'DW';
			}
			if($row[1] == 1){ $row[1] =  'SM';
			}
			if($row[1] == 16){ $row[1] =  'DK';
			}
			if($row[1] == 17){ $row[1] =  'BK';
			}
			if($row[1] == 32){ $row[1] =  'Elf';
			}
			if($row[1] == 33){ $row[1] =  'ME';
			}
			if($row[1] == 48){ $row[1] =  'MG';
			}
			if($row[1] == 64){ $row[1] =  'DL';
			}
			echo "<tr>
			  <td valign=top align=left bgcolor=#000000 class=style1>$rank</td>
              <td valign=top align=left bgcolor=#000000 class=style1>$row[0]</td>
              <td valign=top align=left bgcolor=#000000 class=style1>$row[1]</td>
              <td valign=top align=left bgcolor=#000000 class=style1>$row[2]</td>
			  <td valign=top align=left bgcolor=#000000 class=style1>$row[3]</td>
			  <td valign=top align=left bgcolor=#000000 class=style1>$row[4]</td>
			  <td valign=top align=left bgcolor=#000000 class=style1>$row[5]</td>
			  <td valign=top align=left bgcolor=#000000 class=style1>$row[6]</td>
              </tr>";
			}
		?>
        </table>
        <br>
        <input name="Button" type="button" class="campos" value="Atualizar" onClick="javascript:window.location='ranken.php'"></td>
      </tr>
      <tr>
        <td height="564"></td>
      </tr>
      </table>
    </td>
  </tr>
</table>
</body>
</html>